From 6d303dacab7a3f0cd3e06471acd623b48de83d0e Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Tue, 23 Mar 2004 08:30:15 +0000 Subject: [PATCH] bitkeeper revision 1.819 (405ff597IZG6ZJZ_KUXF4rm3sEo57A) console_client.py, xencons, Makefile, Console-HOWTO.txt: Console and controller modifications. xend: new file xendomains: Rename: tools/examples/xendomains -> tools/examples/init.d/xendomains --- .rootkeys | 3 ++- docs/Console-HOWTO.txt | 8 +++++++ tools/examples/Makefile | 2 +- tools/examples/init.d/xend | 33 ++++++++++++++++++++++++++ tools/examples/{ => init.d}/xendomains | 0 tools/misc/xencons | 4 ++-- tools/xenctl/lib/console_client.py | 4 ++-- 7 files changed, 48 insertions(+), 6 deletions(-) create mode 100755 tools/examples/init.d/xend rename tools/examples/{ => init.d}/xendomains (100%) diff --git a/.rootkeys b/.rootkeys index 682628e263..aeda8c823a 100644 --- a/.rootkeys +++ b/.rootkeys @@ -46,12 +46,13 @@ 401d7e16UgeqroJQTIhwkrDVkoWgZQ tools/examples/README 401d7e16GS8YesM1zateRbaOoI6YLQ tools/examples/defaults 401d7e16NoWaBGC1RXbBcqAOr5Uaag tools/examples/democd +405ff55dawQyCHFEnJ067ChPRoXBBA tools/examples/init.d/xend +40278d94cIUWl2eRgnwZtr4hTyWT1Q tools/examples/init.d/xendomains 40278d91ZjLhxdjjrGe8HEdwHLj5xQ tools/examples/netbsd 401d7e16NpnVrFSsR7lKKKfTwCYvWA tools/examples/xc_dom_control.py 401d7e16RJj-lbtsVEjua6HYAIiKiA tools/examples/xc_dom_create.py 403b7cf7J7FsSSoEPGhx6gXR4pIdZg tools/examples/xc_physinfo.py 401d7e16X4iojyKopo_j63AyzYZd2A tools/examples/xc_vd_tool.py -40278d94cIUWl2eRgnwZtr4hTyWT1Q tools/examples/xendomains 3f776bd2Xd-dUcPKlPN2vG89VGtfvQ tools/misc/Makefile 3f6dc136ZKOjd8PIqLbFBl_v-rnkGg tools/misc/miniterm/Makefile 3f6dc140C8tAeBfroAF24VrmCS4v_w tools/misc/miniterm/README diff --git a/docs/Console-HOWTO.txt b/docs/Console-HOWTO.txt index 5d8d5ee3e2..7844d97f77 100644 --- a/docs/Console-HOWTO.txt +++ b/docs/Console-HOWTO.txt @@ -56,6 +56,14 @@ Virtual console for other domains rc.local): # /usr/sbin/xend start + Alternatively, Redhat- and LSB-compatible Linux installations can use + the provided init.d script. To integrate startup and shutdown of xend + in such a system, you will need to run a few configuration commands: + # chkconfig --add xend + # chkconfig --level 35 on + # chkconfig --level 01246 off + This will avoid the need to run xend manually from rc.local, for example. + Note that, when a domain is created using xc_dom_create.py, xend MUST be running. If everything is set up correctly then xc_dom_create will print the local TCP port to which you should connect to perform diff --git a/tools/examples/Makefile b/tools/examples/Makefile index 570e291f66..1f57924338 100644 --- a/tools/examples/Makefile +++ b/tools/examples/Makefile @@ -1,7 +1,7 @@ INSTALL = $(wildcard *.py) ETC = defaults democd netbsd -INITD = xendomains +INITD = init.d/xendomains init.d/xend all: diff --git a/tools/examples/init.d/xend b/tools/examples/init.d/xend new file mode 100755 index 0000000000..bf1cc93e3d --- /dev/null +++ b/tools/examples/init.d/xend @@ -0,0 +1,33 @@ +#!/bin/bash +# +# xend Script to start and stop the Xen control daemon. +# +# Author: Keir Fraser +# +# chkconfig: 2345 99 00 +# description: Starts and stops the Xen control daemon. + +. /etc/init.d/functions + +case "$1" in + start) + xend start + exit $? + ;; + stop) + xend stop + exit $? + ;; + status) + ;; + restart|reload) + ;; + *) + # do not advertise unreasonable commands that there is no reason + # to use with this device + echo $"Usage: $0 {start|stop|status|restart|reload}" + exit 1 +esac + +exit 0 + diff --git a/tools/examples/xendomains b/tools/examples/init.d/xendomains similarity index 100% rename from tools/examples/xendomains rename to tools/examples/init.d/xendomains diff --git a/tools/misc/xencons b/tools/misc/xencons index b826c89dee..31c87a1ed7 100755 --- a/tools/misc/xencons +++ b/tools/misc/xencons @@ -26,7 +26,7 @@ def __recv_from_sock(sock): stop = False while not stop: try: - data = sock.recv(1) + data = sock.recv(1024) os.write(1, data) except socket.error, error: if error[0] != errno.EINTR: @@ -35,7 +35,7 @@ def __recv_from_sock(sock): def __send_to_sock(sock): while 1: - data = os.read(0,1) + data = os.read(0,1024) if ord(data[0]) == ord(']')-64: break try: diff --git a/tools/xenctl/lib/console_client.py b/tools/xenctl/lib/console_client.py index b826c89dee..31c87a1ed7 100644 --- a/tools/xenctl/lib/console_client.py +++ b/tools/xenctl/lib/console_client.py @@ -26,7 +26,7 @@ def __recv_from_sock(sock): stop = False while not stop: try: - data = sock.recv(1) + data = sock.recv(1024) os.write(1, data) except socket.error, error: if error[0] != errno.EINTR: @@ -35,7 +35,7 @@ def __recv_from_sock(sock): def __send_to_sock(sock): while 1: - data = os.read(0,1) + data = os.read(0,1024) if ord(data[0]) == ord(']')-64: break try: -- 2.30.2